<div class="col-md-3 list-group">
    <a href="#" class="list-group-item disabled">用户设置</a>
    <a href="/settings/profile" class="list-group-item  profile">基本信息</a>
    <a href="/settings/admin?id={{ user._id }}" class="list-group-item noprofile">账户设置</a>
</div>
<script src="/node_modules/jquery/dist/jquery.js"></script>
<script>
    // 这个正则表达式可以来检查一个字符串中是否含有/settings/profile
    const reg = new RegExp("/settings/profile", "i");
    const usr = document.location.href
    const result = reg.test(usr);
    if (result) {
        $(".profile").addClass('active')
    } else {
        $(".noprofile").addClass('active')
    }
</script>